Debugging video filters |
Debugging a video filter can be tricky. Here's a few tips to help keep the bugs out.
Auto-loading filters |
The most important trick to debugging a video filter is to have VirtualDub automatically load the filter at startup. This is done with a special command-line syntax:
virtualdub !g:\projwin\testfilt\debug\testfilt.vcf
This syntax is currently incompatible with any command-line switches, unfortunately.
Alternatively, you can modify the compile project to copy or link the file into the PLUGINS\ directory in VirtualDub's program directory.
Use a configuration file |
If you find a troublesome configuration, save it as a .vcf file. That way, you can recreate the configuration quickly. This helps when the setup is complex, and allows you to construct a testing job list from all the .vcf files later on.
Test odd dimensions and odd files |
Make sure to test odd sizes such as 307x461. This is easily accomplished with the resize filter, and may expose errant boundary conditions or alignment issues in your code. Make sure to test the color extremes as well, such as highly saturated colors, 0% blacks, and 100% whites, to verify color clipping code.
Inhibiting VirtualDub's crash handler |
It is highly recommended that you run VirtualDub.exe directly from your debugger, which will intercept any exceptions and point you to the error in your source code. When this is not feasible, you may want to disable VirtualDub's crash handler. You can do this by using the undocumented /h flag, or alternatively, call SetUnhandledExceptionFilter(NULL) in your code. The regular Windows unhandled exception processing will then take over. If you use the latter method, make sure you remove the call before releasing your filter to the world, so that VirtualDub can produce crash dumps.
VirtualDub external filter SDK 1.05 | ©1999-2001 Avery Lee <phaeron@virtualdub.org> |